package com.wutao.panzh.admin.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.panzh.entity.SceneryClassification;
import com.wutao.panzh.admin.mapper.SceneryClassificationMapper;
import com.wutao.panzh.service.SceneryClassificationService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class SceneryClassificationServiceImpl implements SceneryClassificationService {

    @Autowired
    private SceneryClassificationMapper sceneryClassificationMapper;

    @Override
    public List<SceneryClassification> getAllClassIfication() {
        //使用通用mapper快速搞定；
        List<SceneryClassification> list = sceneryClassificationMapper.selectAll();
        return list;
    }

    @Override
    public void insertSceneryClassification(String classificationName) {
        SceneryClassification sceneryClassification = new SceneryClassification();
        sceneryClassification.setCategorizationInformation(classificationName);
        sceneryClassificationMapper.insert(sceneryClassification);
    }

    @Override
    public void deleteSceneryClassification(String itemId) {
        int Id = Integer.parseInt(itemId);
        SceneryClassification sceneryClassification = new SceneryClassification();
        sceneryClassification.setId(Id);
        sceneryClassificationMapper.delete(sceneryClassification);
    }
}
